package com.inspur.edp.formserver.vmmanager.service;

/*import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.inspur.edp.lcm.metadata.api.entity.GspMetadata;
import com.inspur.edp.lcm.metadata.common.Utils;
import com.inspur.edp.metadata.rtcustomization.spi.MetadataBeforeSaveToDBExtend;
import com.inspur.edp.formserver.vmmanager.ContentSerializer;

public class SimplifyVoBeforeSavedToDB implements MetadataBeforeSaveToDBExtend {

    public String execute(GspMetadata gspMetadata){
        ContentSerializer serializer = new ContentSerializer();
        JsonNode jsonNode = serializer.Serialize(gspMetadata.getContent());
        ObjectMapper mapper = Utils.getMapper();
        String mdValue;
        try {
            mdValue = mapper.writeValueAsString(jsonNode);
        }catch (JsonProcessingException e){
            throw new RuntimeException("序列化失败，元数据id："+gspMetadata.getHeader().getId());
        }
        return mdValue;
    }

}*/
